package com.wonders.qxmanager.service.impl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wonders.qxmanager.base.WidgetPage;
import com.wonders.qxmanager.dao.RoleDao;
import com.wonders.qxmanager.model.Role;
import com.wonders.qxmanager.service.RoleService;
import com.wonders.qxmanager.utils.PageArrayList;

@Service
public class RoleServiceImpl implements RoleService {
	
	@Autowired
	private RoleDao roleDao;

	@Override
	public void addRole(Role role) {
		roleDao.addRole(role);
	}

	@Override
	public void updateRole(Role role) {
		roleDao.updateRole(role);
	}

	@Override
	public void deleteRole(BigDecimal id) {
		roleDao.deleteById(id);
	}

	@Override
	public PageArrayList<Role> getListByPage(Role role, WidgetPage page) {
		return roleDao.getListByPage(role, page);
	}

	@Override
	public List<Role> getAll() {
		return roleDao.getAll();
	}

	@Override
	public Role getRoleById(BigDecimal id) {
		return roleDao.getRoleById(id);
	}

}
